home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-19
/
3ddcad02.zip
/
DEMOMAIN.MAC
< prev
next >
Wrap
Text File
|
1991-10-26
|
12KB
|
436 lines
; DEMOMAIN.MAC, demo for DANCAD3D v2.0 release version
; Copyright (c) 1987, Daniel H. Hudgins, All rights reserved.
; The latest set of disks and manual can be ordered from me.
; Write to: DANCAD3D, 466 Diamond St., San Francisco, CA 94114.
; Begin set up
INIT ; clear DANCAD3D's workspace
WORLD 240 ; set world scale to inches
; End Set up
; Begin intro massage
TEXT_MODE
LOCATE 1 4
ECHO DANCAD3D v2.x demo macro DEMOMAIN.MAC
LOCATE 1 6
ECHO DANCAD3D can run it self from an ASCII text file of commands. These
ECHO commands let you initiate powerful and complex series of operations on drawings
ECHO and 3D environments with a single filename for that text file. You can put any
ECHO number of commands in one of these files so they are called macros. Macros are
ECHO big jobs given a simple user defined name. DANCAD3D gives you a valuable
ECHO kernel to start with, you can then extend it to any degree filling your
ECHO harddisk with procedures and functions that can call each other. Since v2.x
ECHO has commands to format the text on screen and have user console input and
ECHO output you can design data entry menus for the sale of custom macros for all
ECHO kinds of applications.
LOCATE 1 17
ECHO This is a simple example since the distribution disk space is limited.
ECHO More complex examples come as part of the 14 disk set.
LOCATE 1 20
ECHO Press [Return] to continue.
WAIT
; End intro message
; Begin make Small Gear
TRACE OFF 500 ; just in case is was left on
TEXT LOCATE 25 12 ECHO <WORKING: Making the small gear> %%
INIT
; tooth
ENTER_DATA
231 -60 -50 331 -40 -50 1 1 0 0
331 -40 -50 331 40 -50 1 1 0 0
331 40 -50 231 60 -50 1 1 0 0
231 60 -50 231 -60 -50 1 1 0 0
231 -60 50 331 -40 50 1 1 0 0
331 -40 50 331 40 50 1 1 0 0
331 40 50 231 60 50 1 1 0 0
231 60 50 231 -60 50 1 1 0 0
231 -60 50 231 -60 -50 1 1 0 0
331 -40 50 331 -40 -50 1 1 0 0
331 40 50 331 40 -50 1 1 0 0
231 60 50 231 60 -50 1 1 0 0
0 0 0 0 0 0 0 0 0 0
TRACE ON 0
:SMALL
# 1 COPY
LET ELES -> ELEMENTS
# ELES ROTATE Z 0 0 [ 45 * ( ELES - 1 ) ]
IF ELES < 8 THEN GOTO :SMALL
RELEASE ELES
POLYGON 8 8 250 1 1 0 0 # 9 ROTATE Z 0 0 22.5 # 9 OFFSET C 0 0 -50
# 9 THICKEN Z 100
POLYGON 24 24 75 1 1 0 0 # 10 OFFSET C 0 0 -50 ; hole
# 10 THICKEN Z 100
# 0 MAGNIFY Z 1 1 2
# 0 SAVE 3D-Quick SMALL.3D
TRACE OFF 500 ; set delay for next use
; End make a Small Gear
; Start show Small Gear
GRAPH_MODE B&W
# 0 DISPLAY -11.25 -11.25 0 -1500 1.8 1 0 0
LOCATE 1 1 ECHO The Small Gear. Press [Return].
WAIT
; End show Small Gear
; Start Make the Large Gear
TEXT LOCATE 25 12 ECHO <WORKING: Making the Large Gear> %%
INIT
; tooth
ENTER_DATA
491 -60 -50 591 -40 -50 1 1 0 0
591 -40 -50 591 40 -50 1 1 0 0
591 40 -50 491 60 -50 1 1 0 0
491 60 -50 491 -60 -50 1 1 0 0
491 -60 50 591 -40 50 1 1 0 0
591 -40 50 591 40 50 1 1 0 0
591 40 50 491 60 50 1 1 0 0
491 60 50 491 -60 50 1 1 0 0
491 -60 50 491 -60 -50 1 1 0 0
591 -40 50 591 -40 -50 1 1 0 0
591 40 50 591 40 -50 1 1 0 0
491 60 50 491 60 -50 1 1 0 0
0 0 0 0 0 0 0 0 0 0
TRACE ON 0
:LARGE
# 1 COPY
LET ELES -> ELEMENTS
# ELES ROTATE Z 0 0 [ 22.5 * ( ELES - 1 ) ]
IF ELES < 16 THEN GOTO :LARGE
RELEASE ELES
POLYGON 16 16 500 1 1 0 0 # 17 ROTATE Z 0 0 11.25 # 17 OFFSET C 0 0 -50
# 17 THICKEN Z 100
POLYGON 24 24 75 1 1 0 0 # 18 OFFSET C 0 0 -50 ; holes
# 18 THICKEN Z 100
# 0 MAGNIFY Z 1 1 2
# 0 SAVE 3D-Quick LARGE.3D
TRACE OFF 500 ; delay to 1/2 second , turn it off
; End of Make Large Gear
; Start show Large Gear
GRAPH_MODE B&W
# 0 DISPLAY -11.25 -11.25 0 -2000 .9 1 0 0
LOCATE 1 1 ECHO The Large Gear. Press [Return].
WAIT
; End show Large Gear
; Begin Show Gears Pair Still
TEXT LOCATE 25 12 ECHO <WORKING: Making the Gear Pair> %%
INIT
LOAD 3D-Quick SMALL.3D # 1 OFFSET C -302 0 0 # 1 ROTATE C 0 0 22.5
LOAD 3D-Quick LARGE.3D # 2 OFFSET C 552 0 0
FILES ERASE SMALL.3D
FILES ERASE LARGE.3D
; border, this was drawn in [F] (front) from main menu and brought in
; by saving it ASCII and reading it in with ^K^R. It could just as well
; be on a file, but this saves disk space.
ENTER
-955 -648 0 955 -648 0 1 1 0 0
955 -648 0 955 648 0 1 1 0 0
955 648 0 -955 648 0 1 1 0 0
-955 648 0 -955 -648 0 1 1 0 0
0 0 0 0 0 0 0 0 0 0
Lettering
DANCAD 3D
-900 555 0 0 0 0 80 80 3 1 0 0 0 .4 .35 1 F P DanCAD3D.Fon
GRAPH_MODE B&W
# 1 Display 0 -18 0 -4000 .88 1 -320 0
# 2 Display 0 -18 0 -4000 .88 1 -320 0
# 3 Display 0 0 0 -1E18 1 1 0 0
# 4 Display 0 0 0 -1E18 1 1 0 0
LOCATE 2 2 ECHO Press [Return].
WAIT
; End Show Gears Pair Still
; Begin Show Gears Pair Moving
TEXT_MODE
ECHO DEMOMAIN.MAC demo for DANCAD3D v2.x release version, FIRST ANIMATION.
ECHO -
ECHO The next part of this demo shows how you can animate wire frames. It is a
ECHO perspective view of gears turning. It turns 3 teeth then goes on to show you
ECHO some more animation. If you used INSTALL there is a subdirectory named \PIX
ECHO that will hold the frame files, otherwise you need to make one from DOS and run
ECHO the demo again, i.e. C>MD PIX from DANCAD3D's directory.
ECHO -
ECHO If you order the 14 disks and manual disks for $35 you will get DANMOVIE
ECHO v2.x a program that lets you run sets of pixel frame files from memory rapidly
ECHO and smoothly with motion forward, reverse, and, back & forth, at different
ECHO speeds. It is useful to see how action will look in a film-video and to see
ECHO how parts fit. DANMOVIE v2.x supports color CGA, b&w EGA, and Hercules (tm).
ECHO -
ECHO Press [Return] then ^X if you have seen all of the demo and want to print
ECHO out the perspective drawing of the gears. Then press [H] (for hard copy) then
ECHO [D] [W] for dot or [P] [P] for plotter.
ECHO -
ECHO The frames that fallow are not all the same, if you look closely you will
ECHO see that the gears turn a little between frames. When they are run rapidly
ECHO they will look like they are moving.
LOCATE 1 25 ECHO Press [Return] to continue the demo. %%
WAIT_FOR_RETURN
TEXT LOCATE 23 12 ECHO <WORKING: Animating the Gear Pair> %%
DELAY 1000 ; to give time to press ^X
NAME 1 = PIX\DEMOFR-A 0
LET FRAMES = 1
:FIRST_ANIMATION
GRAPH_MODE B&W
# 1 Display 0 -18 0 -4000 .88 1 -320 0
# 2 Display 0 -18 0 -4000 .88 1 -320 0
# 3 Display 0 0 0 -1E18 1 1 0 0
# 4 Display 0 0 0 -1E18 1 1 0 0
SAVE PIXEL NAME 1 NEXT
LOCATE 2 2 OUTPUT FRAMES ECHO frames down, %%
OUTPUT [ 20 - FRAMES ] ECHO to go.
LET FRAMES = [ FRAMES + 1 ]
# 1 ROTATE C 0 0 2.25
# 2 ROTATE C 0 0 -1.125
LOOP :FIRST_ANIMATION 19
RELEASE FRAMES
BEEP ; so you can know when it is done
LOCATE 2 2 ECHO Press [Return] to start.
WAIT
LET FRAMES = 20 ; pass number of frames to DEMO-SUB.MAC
LET FNAME = 1 ; pass ordinal value for frame set name
RUN DEMO-SUB.MAC ; call subroutine
RELEASE FRAMES ; clean up disk space
RELEASE FNAME
; End Show Gears Pair Moving
; Begin Show Gears in close up of Pair Moving
TEXT_MODE
ECHO DEMOMAIN.MAC demo for DANCAD3D v2.x release version, SECOND ANIMATION.
ECHO -
ECHO The next part of this demo shows how you can animate a 2D projection of the
ECHO moving gears by altering the arguments to the DISPLAY command. These 2D
ECHO projections are useful to check the range of motion of parts to make sure they
ECHO are going to fit together correctly.
ECHO -
ECHO Press [Return] then [Control] & [X] if you want to abort the demo.
LOCATE 1 25 ECHO Press [Return] to continue the demo. %%
WAIT_FOR_RETURN
TEXT LOCATE 20 12 ECHO <WORKING: Animating the 2D projection> %%
DELAY 1000 ; to give time to press ^X
NAME 1 = PIX\DEMOFR-B 0
LET FRAMES = 1
:SECOND_ANIMATION
GRAPH_MODE B&W
# 1 Display 0 -0 0 -1E18 1.4 1 50 0
# 2 Display 0 -0 0 -1E18 1.4 1 50 0
# 4 Display 0 0 0 -1E18 1 1 -25 25
SAVE PIXEL NAME 1 NEXT
LOCATE 2 2 OUTPUT FRAMES ECHO frames down, %%
OUTPUT [ 20 - FRAMES ] ECHO to go.
LET FRAMES = [ FRAMES + 1 ]
# 1 ROTATE C 0 0 2.25
# 2 ROTATE C 0 0 -1.125
LOOP :SECOND_ANIMATION 19
RELEASE FRAMES
BEEP ; so you can know when it is done
LOCATE 2 2 ECHO Press [Return] to start.
WAIT
LET FRAMES = 20 ; pass number of frames to DEMO-SUB.MAC
LET FNAME = 2 ; pass ordinal value for frame set name
RUN DEMO-SUB.MAC ; call subroutine
RELEASE FRAMES ; clean up disk space
RELEASE FNAME
; End Show Gears in close up of Pair Moving
; Begin Show Gears in close up of Pair Moving
TEXT_MODE
ECHO DEMOMAIN.MAC demo for DANCAD3D v2.x release version, THIRD ANIMATION.
ECHO -
ECHO This demo shows that you can combine changes in perspective while parts are
ECHO animated to give an impression of looking around a simulated mechanism in
ECHO operation.
ECHO This animation makes 200 frames, so you will need some space on your
ECHO harddisk for them to be stored, the requirements are:
ECHO -
ECHO * CGA board, needs 3.3M harddisk bytes free,
ECHO * EGA board, needs 5.7M harddisk bytes free, and
ECHO * Hercules (tm) card needs, harddisk 6.6M bytes free.
ECHO -
ECHO The two gears will rotate, along a line passing through their centers of
ECHO rotation, 360 degrees while 10 teeth mesh as they turn at their 2:1 ratio.
ECHO -
ECHO You can film this with any single frame cine camera to view the animation
ECHO at higher speeds. Saving the images on cine film or stop motion VCR frees you
ECHO from the limits of your harddisk's storage space and lack of speed. DANMOVIE
ECHO v2.x can be used for tests if you save every tenth or hundredth frame to get a
ECHO quick idea of how the final result will look.
ECHO -
ECHO Press [Return] then [Control] & [X] if you want to abort the demo.
LOCATE 1 25 ECHO Press [Return] to continue the demo. %%
WAIT_FOR_RETURN_TO_BE_PRESSED
TEXT LOCATE 19 12 ECHO <WORKING: Animating the Compound Motion> %%
DELAY 1000 ; to give time to press ^X
NAME 1 = PIX\DEMOFR-C 0
LET FRAMES = 1
LET XROT = 0
:THIRD_ANIMATION
GRAPH_MODE B&W
# 1 COPY # 5 ROTATE Z XROT 0 0
# 2 COPY # 6 ROTATE Z XROT 0 0
# 5 Display 0 -18 0 -4000 .85 1 -320 0
# 6 Display 0 -18 0 -4000 .85 1 -320 0
# 3 Display 0 0 0 -1E18 1 1 0 0
# 4 Display 0 0 0 -1E18 1 1 0 0
# 6 ERASE
# 5 ERASE
SAVE PIXEL NAME 1 NEXT
LOCATE 2 2 OUTPUT FRAMES ECHO frames down, %%
OUTPUT [ 200 - FRAMES ] ECHO to go.
LET FRAMES = [ FRAMES + 1 ]
LET XROT = [ XROT + 1.8 ]
# 1 ROTATE C 0 0 2.25
# 2 ROTATE C 0 0 -1.125
LOOP :THIRD_ANIMATION 199
RELEASE FRAMES
BEEP ; so you can know when it is done
LOCATE 2 2 ECHO Press [Return] to start.
WAIT
LET FRAMES = 200 ; pass number of frames to DEMO-SUB.MAC
LET FNAME = 3 ; pass ordinal value for frame set name
RUN DEMO-SUB.MAC ; call subroutine
RELEASE FRAMES ; clean up disk space
RELEASE FNAME
; End Show Gears in close up of Pair Moving
; Start Final words
TEXT
ECHO Well that's all for this demo. The gears are still in the workspace so you
ECHO can work with them if you wish. Press [Return] to exit to the main menu then
ECHO press [D] to go into the drawing editor. Press [Return] when asked which
ECHO elements to display, then pick the [F]ront view to display. Press [D] to enter
ECHO the drawing sub-menu then press the [+] key to zoom in. Move the zoom border
ECHO around with your mouse-trackball or cursor keys, then press the [*/PrtSc] key
ECHO to redraw the screen. Play with the zoom for a while by using [+] to zoom in
ECHO and [-] or [S]cale to zoom out. If you want to make your own drawing press
ECHO [Return] back to the drawing root menu then press [I] (initialize) to clear the
ECHO workspace. Press [T] (tutor) and read the explanation of how to draw lines.
WAIT
; End Final Words
; End DEMOMAIN.MAC